﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace RegionSplittor.Utils
{
	internal class XyzEqualityComparer : IEqualityComparer<XYZ>
	{
		public XyzEqualityComparer(double eps)
		{
			this._eps = eps;
		}

		public bool Equals(XYZ p, XYZ q)
		{
			return this._eps > p.DistanceTo(q);
		}

		public int GetHashCode(XYZ p)
		{
			return UtilityTools.PointString(p).GetHashCode();
		}

		private double _eps;
	}
}
